#include"BSTree.h"

void test1(){
    int arr[]={3,5,1,2,9,8,6,7,0};
    BSTree<int> t;
    for(auto e:arr){
        t.Insert(e);
    }
    t.InOrder();
}

void test2(){
    int arr[]={6,3,0,5,9,1,2,4,8,7};
    BSTree<int> t;
    for(auto e:arr){
        t.Insert(e);
    }
    t.InOrder();

    cout<<t.Erase(3)<<endl;
    t.InOrder();

    cout<<t.Erase(8)<<endl;
    t.InOrder();

    cout<<t.Erase(100)<<endl;
}

void test3(){
    int arr[]={6,3,0,5,9,1,2,4,8,7};
    BSTree<int> t;
    for(auto e:arr){
        t.InsertR(e);
    }
    t.InOrder();

    for(auto a:arr){
        t.EraseR(a);
        t.InOrder();
    }
}

void test4(){
    int arr[]={6,3,0,5,9,1,2,4,8,7};
    BSTree<int> T1;
    for(auto e:arr){
        T1.InsertR(e);
    }
    BSTree<int> T2(T1);
    T2.InOrder();

    BSTree<int> T3;
    T3=T1;
    T3.InOrder();

    cout<<T3.FindR(8)<<endl;
    cout<<T3.FindR(100)<<endl;
}

int main(){
    //test1();
    //test2();
    //test3();
    test4();

    return 0;
}